
"""
Created on Tue Feb 19 14:55:43 2013

@author: aponteeduarddo@gmail.com
Copyright Eduardo Aponte 2013.
"""

from mex_binder import binder_py

mx_eyelink_tracker_mode = binder_py('mx_eyelink_tracker_mode')
mx_eyelink_tracker_mode.mx_c.headers = ['<eyelink.h>','"mex.h"']
mx_eyelink_tracker_mode.bindo += []
mx_eyelink_tracker_mode.mx_c.code = \
"""
INT16 _main( void )
{
    return eyelink_tracker_mode(  ); ;
}

void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
    mwSize td[2] = {1,1};
    double *status;
    
    /* Verify input arguments. */
    if(nrhs != 0 ) {
        mexErrMsgTxt("Incorrect number of inputs.");
    } else if( nlhs > 1 ) {
        mexErrMsgTxt("Too many output arguments.");
    }
            
    plhs[0] = mxCreateNumericArray( 2, td, mxDOUBLE_CLASS, mxREAL);
    status = mxGetPr(plhs[0]);    
    *status = (double ) _main( ); 
    return;
}
"""

mx_eyelink_tracker_mode.mx_c.mdoc = \
"""function [ status ] = mx_eyelink_tracker_mode( )
%MX_EYELINK_TRACKER_MODE Returns raw EyeLink mode numbers, defined in eyelink.h
% as EL_xxxx definitions.
%
%Returns:
% Raw EyeLink mode, -1 if link disconnected
%
% EL_IDLE_MODE         1
% EL_IMAGE_MODE        2
% EL_SETUP_MENU_MODE   3
%
% EL_USER_MENU_1       5
% EL_USER_MENU_2       6
% EL_USER_MENU_3       7
%
% EL_OPTIONS_MENU_MODE  8  /* NEW FOR EYELIKN II */
%
% EL_OUTPUT_MENU_MODE  9
%
% EL_DEMO_MENU_MODE    10
% EL_CALIBRATE_MODE    11
% EL_VALIDATE_MODE     12
% EL_DRIFT_CORR_MODE   13
% EL_RECORD_MODE       14
%
"""
mx_eyelink_tracker_mode.write_c()
mx_eyelink_tracker_mode.write_m()
mx_eyelink_tracker_mode.compile()
mx_eyelink_tracker_mode.write_sh()

